package com.xixi.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.xixi.pojo.dto.LoginUserDTO;
import com.xixi.entity.User;
import com.xixi.pojo.query.UserQueryPage;
import com.xixi.pojo.vo.UserVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface UserMapper extends BaseMapper<User> {
    @Select("select * from users where username=#{username}")
    LoginUserDTO userLogin(LoginUserDTO loginUserDTO);
    @Select("select * from users")
    List<UserVO> list();
    @Select("select id from users where name=#{name}")
    Integer getUserIdNyName(String name);
    @Select("select * from users where id=#{id}")
    UserVO getUserById(Integer id);

    IPage<UserVO> getUserPage(IPage<UserVO> page, UserQueryPage userQueryPage);
}
